package com.breaktian.demoapp.application;

import android.app.Application;
import android.support.multidex.MultiDex;

import com.breaktian.assemble.router.VpRouter;
import com.breaktian.demoapp.hotfix.andfix.AndFixManager;
import com.breaktian.network.api.base.BaseApi;
import com.breaktian.shell.global.AppGlobal;
import com.breaktian.shell.moduleservice.core.ModuleServicer;

/**
 * Created by tiankeke on 2017/5/3.
 */

public class DemoApplication extends Application {

    public static DemoApplication CONTEXT;

    @Override
    public void onCreate() {
        super.onCreate();
        CONTEXT = this;
        AppGlobal.setDebug(true);
        AppGlobal.setContext(CONTEXT);

        initNetwork();
        initRouter();
        initAndFix();
        MultiDex.install(this);

    }




    private void initAndFix() {
        AndFixManager.getInstance().init(CONTEXT);
    }

    private void initNetwork() {
        BaseApi.initHttp(CONTEXT,true);
    }

    private void initRouter() {
        VpRouter.load(getApplicationContext(),"router.xml");
    }



}
